<?php

use think\migration\Migrator;
use think\migration\db\Column;

class AppGpu extends Migrator
{
    /**
     * Change Method.
     *
     * Write your reversible migrations using this method.
     *
     * More information on writing migrations is available here:
     * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
     *
     * The following commands can be used in this method and Phinx will
     * automatically reverse them when rolling back:
     *
     *    createTable
     *    renameTable
     *    addColumn
     *    renameColumn
     *    addIndex
     *    addForeignKey
     *
     * Remember to call "create()" or "update()" and NOT "save()" when working
     * with the Table class.
     */
    public function change()
    {
        $table = $this->table('app_gpu')
            ->setComment('GPU')
            ->addColumn('create_time', 'integer', ['limit' => '11', 'signed' => '0', 'null' => '0', 'default' => '0', 'comment' => '创建时间', ])
            ->addColumn('update_time', 'integer', ['limit' => '11', 'signed' => '0', 'null' => '0', 'default' => '0', 'comment' => '', ])
            ->addColumn('delete_time', 'integer', ['limit' => '11', 'signed' => '0', 'null' => '0', 'default' => '0', 'comment' => '', ])
            ->addColumn('title', 'string', ['limit' => '100', 'null' => '0', 'default' => '', 'comment' => '显卡名称', ])
            ->addColumn('cuda_count', 'biginteger', ['limit' => '20', 'signed' => '0', 'null' => '0', 'comment' => 'CUDA核心数', ])
            ->addColumn('boost_clock', 'double', ['null' => '0', 'default' => '0', 'comment' => '加速频率 （GHz）', ])
            ->addColumn('base_clock', 'double', ['null' => '0', 'default' => '0', 'comment' => '基础频率 （GHz）', ])
            ->addColumn('memory', 'biginteger', ['limit' => '20', 'signed' => '0', 'null' => '0', 'default' => '0', 'comment' => '标准显存（G）', ])
            ->create();
    }
}
